package flyweightPattern;

//具体享元
public class Goods implements IGoods {

    //内部状态
    private String name;

    //外部状态
    private String version;

    public Goods(String name) {
        this.name = name;
    }

    @Override
    public void showGoodsPrice(String version) {

        if ("32GB".equalsIgnoreCase(version)) {
            System.out.println("Price : $6.");
        } else if ("64GB".equalsIgnoreCase(version)) {
            System.out.println("Price : $12.");
        } else {
            System.out.println("Price : $9999.");
        }
    }
}
